<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link type="text/css" rel="stylesheet" href="../css/app.css"/>
    <link type="text/css" rel="stylesheet" href="../css/loginMobile.css"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../datepicker/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
</head>
<body id="Ibody">
<!--
	制作：陈道祥
	页面：公司产量产能
	更新：九哥
-->





<!-----------公司产量产能页面---------->
<div class="stepTwo" id="IstepNineNoFactoryCompanyOutput">
    <div class="companyHeadPanel">
        <div class="companyHeadOne">假如你公司有工厂？请选择</div>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="blankSpace"></div>
    <div class="modelPanel">
        <div class="goodsPanel">
            <div class="departName">核心部门</div>
            <div class="personNum">人数</div>
        </div>
        <span id="departSpan"></span>
    </div>
    <div class="blankSpace"></div>
    <div class="modelPanel">
        <div class="businessTitle">日产量：</div>
        <div class="businessAgePanel">
            <div class="businessAge">
                <input type="text" placeholder="多少件" class="businessAgeValue"
                       id="dayOutPutStart">
            </div>
            <div class="businessAgeLine">--</div>
            <div class="businessAge">
                <input type="text" placeholder="多少件" class="businessAgeValue"
                       id="dayOutPutEnd">
            </div>
        </div>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="modelPanel">
        <div class="businessTitle">质量要求：
            <input type="checkbox" checked="checked" onclick="return false"/>
            &nbsp;多选
        </div>
    </div>
    <div class="modelPanel">
        <div class="goodsPanel">
            <div class="goodsQuality">产品类型</div>
            <div class="goodscheck">几道检验</div>
        </div>
        <span id="requireSpan"></span>
    </div>
    <div class="blankSpace"></div>
    <div class="modelPanel">
        <div class="goodsPanel">
            <div class="departName">部门</div>
            <div class="personNum">人数</div>
        </div>
        <span id="requireDepartSpan"></span>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="blankSpace"></div>
    <div class="modelPanel">
        <span class="standardTitle">质量标准：</span>
        <span class="standardItem">（本标准供质检、总检、车间生产使用）</span>
    </div>
    <span id="standardlist"></span>
    <div class="blankSpace"></div>
    <div class="companyInfoSpace"></div>
    <div class="companyRemark">备注：方便你的客户找到你、招聘的员工找到你、了解你、信任你，图片尽量上传完善。让客户多了解自己，容易接单成功。细节决定成败，图片清晰。</div>
    <div class="nextStepDiv">
        <!--<span class="prevStep" id="comYieldPre">上一步</span>-->
        <!--<span class="nextStep" id="comYieldNext">下一步</span>-->
        <span class="prevStep" onclick="history.go(-1)">返回</span>
        <span class="nextStep" onclick="setSave()">保存</span>
    </div>
</div>
<span id="standardSpan"></span>
<!-----------公司产量产能页面---------->





<!-----------提示信息---------->
<div id="errMsg"></div>
<!-----------提示信息---------->
</body>
<script type="text/javascript" src="../js/loginCom.js"></script>
<script>
    (function(){
        getComYieldList();
    })();
    /**
     * 设置保存
     * */
    function setSave(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo == 'undefined' || userInfo.token == 'undefined') {
            getErrMsg('没有登录！'); return;
        }
        var departCount = $('#departCount').val();
        var requireProCount = $('#requireProCount').val();
        var requireDepartCount = $('#requireDepartCount').val();
        var departs = new Array(),
                requirePros = new Array(),
                requireDeparts = new Array(),
                standards = new Array();
        var i, i2, i3, num, num2;
        //部门人数
        for (i=0;i<departCount;i++) {
            num = $('#departNum-' + i).val();
            if (num=='') { num = 0; }
            departs[i] = {
                key:$('#departKey-' + i).val(),
                num:num
            };
        }
        //日产量
        var dayOutPutStart = $('#dayOutPutStart').val();
        var dayOutPutEnd = $('#dayOutPutEnd').val();
        if (dayOutPutStart=='') { dayOutPutStart = 0; }
        if (dayOutPutEnd=='') { dayOutPutEnd = 0; }
        var dayOutPuts = [
            dayOutPutStart,dayOutPutEnd
        ];
        //质量要求
        for (i2=0;i2<requireProCount;i2++) {
            var val = $('#requireProVal-'+i2).val();
            if (val=='') { val = 0; }
            requirePros[i2] = {
                key:$('#requireProKey-'+i2).val(),val:val
            };
        }
        //质量人数
        for (i3=0;i3<requireDepartCount;i3++) {
            num = $('#requireDepartNum-'+i3).val();
            if (num=='') { num = 0; }
            requireDeparts[i3] = {
                key:$('#requireDepartKey-'+i3).val(),num:num
            };
        }
        //标准
        standards[0] = $('#standard-0').val();
        standards[1] = $('#standard-1').val();
        standards[2] = $('#standard-2').val();
        standards[3] = $('#standard-3').val();
        standards[4] = $('#standard-4').val();
        var yields = {
            departs:departs,
            dayOutPuts:dayOutPuts,
            requirePros:requirePros,
            requireDeparts:requireDeparts,
            standards:standards
        };
        //console.log(yields); return;
        var data = {
            app_access: app_access,
            token: userInfo.token,
            type: userInfo.type,
            cate: userInfo.cate,
            yields:yields
        };
        $.ajax({
            type: 'post',
            url: getDomain() + 'com-yield-set',
            data: data,
            success: function (res) {
                //console.log(res); return;
                if (res.code != 0) {
                    getErrMsg(res.msg); return;
                }
                window.location.href = '/h5/login/comList.html';
            },
            error:function(){
                getErrMsg('操作失败！'); return;
            }
        });
    }
</script>
</html>